Greetings,
I am having an issue when I run my homing program. It appears to happen immediately after the axises are enabled. This only appears to happen when one of the stepper motors position has changed with the axis disabled. I think what is happening is when it is re-enabled the stepper pulls upon power up, this immediately causes a following error, and prevents the axis from homing. If I press the homing button two times it seems to home.
I am thinking that maybe a fix would be to enable all of the axises, and then wait for a given amount of time for the motors to move, and then enable them again. Does this approach make sense?
I would like some help with a piece of C Code that would cause a wait time. I know this is a basic question, but would appreciate some help.

Thanks,
Scott